#define _CRT_SECURE_NO_WARNINGS
#include"sort.h"
#include"stack.h"

void InsertTest()
{
	int a[] = { 9,8,6,5,7,4,2,3,1 };
	InsertSort(a, sizeof(a) / sizeof(a[0]));
	print(a, sizeof(a) / sizeof(a[0]));
}

void BubbleTest()
{
	int a[] = { 9,8,6,5,7,4,2,3,1 };
	BubbleSort(a, sizeof(a) / sizeof(a[0]));
	print(a, sizeof(a) / sizeof(a[0]));
}

void HeapTest()
{
	int a[] = { 9,8,6,5,7,4,2,3,1 };
	HeapSort(a, sizeof(a) / sizeof(a[0]));
	print(a, sizeof(a) / sizeof(a[0]));
}

void ShellSortTest()
{
	int a[] = { 9,8,6,5,7,4,2,3,1,8,9,5,6,4,5,2,5,4,5,8,4,5,8,2,56,4,2,1,5,5,1 };
	ShellSort(a, sizeof(a) / sizeof(a[0]));
	print(a, sizeof(a) / sizeof(a[0]));
}

void SelectSortTest()
{
	int a[] = { 9,8,6,5,7,4,2,3,1,8,9,5,6,4,5,2,5,4,5,8,4,5,8,2,56,4,2,1,5,5,1 };
	SelectSort(a, sizeof(a) / sizeof(a[0]));
	print(a, sizeof(a) / sizeof(a[0]));
}
void SelectSortProTest()
{
	int a[] = { 9,8,6,5,7,4,2,3,1,8,9,5,6,4,5,2,5,4,5,8,4,5,8,2,56,4,2,1,5,5,1 };
	SelectSortPro(a, sizeof(a) / sizeof(a[0]));
	print(a, sizeof(a) / sizeof(a[0]));
}

void QuickSortTest()
{
	int a[] = { 9,8,6,5,7,4,2,3,1,8,9,5,6,4,5,2,5,4,5,8,4,5,8,2,56,4,2,1,5,5,1 };
	
	//QuickSort(a, 0, sizeof(a) / sizeof(a[0]) - 1);
	//EasyQuickSort(a, 0, sizeof(a) / sizeof(a[0])-1);
	QuickSortNonR(a, 0, sizeof(a) / sizeof(a[0]) - 1);
	print(a, sizeof(a) / sizeof(a[0]));
}

void MergeSortTest()
{
	int a[] = { 9,8,6,5,7,4,2,3,1 };
	//MergeSort(a, sizeof(a) / sizeof(a[0]));
	MergeSortNonR(a, sizeof(a) / sizeof(a[0]));

	print(a, sizeof(a) / sizeof(a[0]));
}

void CountSortTest()
{
	int a[] = { 9,8,6,5,7,4,2,3,1,8,9,5,6,4,5,2,5,4,5,8,4,5,8,2,56,4,2,1,5,5,1 };
	CountSort(a, sizeof(a) / sizeof(a[0]));
	print(a, sizeof(a) / sizeof(a[0]));

}



int main()
{
	//InsertTest();
	//BubbleTest();
	//HeapTest();
	//ShellSortTest();
	//SelectSortTest();
	//SelectSortProTest();
	//QuickSortTest();
	//MergeSortTest();
	//CountSortTest();
	return 0;
}